package testpackage.common.utils;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;

import org.junit.Test;

import com.common.utils.PropertiesUtils;

public class TPropertiesUtils {
	
	@Test
	public void t_URLGetValue(){
		PropertiesUtils.getInstance("D:/WorkSoft/WorkSpace/Study/JavaSimpleExamples/src/com/common/config/jdbc.properties");
		System.out.println(PropertiesUtils.getValue("URL"));
	}
	
	@Test
	public void t_fileGetValue(){
		File file = new File("D:/WorkSoft/WorkSpace/Study/JavaSimpleExamples/src/com/common/config/jdbc.properties");
		PropertiesUtils.getInstance(file);
		System.out.println(PropertiesUtils.getValue("MSSQL_URL"));
	}
	
	@Test
	public void t_streamGetValue() throws FileNotFoundException{
		File file = new File("D:/WorkSoft/WorkSpace/Study/JavaSimpleExamples/src/com/common/config/jdbc.properties");
		PropertiesUtils.getInstance(new FileInputStream(file));
		System.out.println(PropertiesUtils.getValue("MSSQL_URL"));
	}
}
